home *** CD-ROM | disk | FTP | other *** search
/ PC World 2006 November / PCWorld_2006-11_cd.bin / v cisle / feedreader / FeedReader306Setup.exe / {app} / stylesheet / atom.xsl next >
Extensible Markup Language  |  2006-08-15  |  6KB  |  236 lines

  1. ∩╗┐<?xml version="1.0" ?>
  2.  
  3. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  4.                 xmlns:feed="http://www.w3.org/2005/Atom"
  5.                 xmlns:fr="http://www.feedreader.com/ns/3.0"
  6.                 version="1.0">
  7. <xsl:output method="html" />
  8.  
  9. <xsl:template match="/">
  10.  
  11. <html>
  12.   <head>
  13.     <title><xsl:value-of select="/feed:feed/feed:title"/></title>
  14.     <link rel="stylesheet" href="atom.css"/>
  15.     <style>
  16.  
  17. body {
  18.  font-family: verdana, tahoma;
  19.  font-size: 0.7em;
  20.  line-height: 1.3em;
  21.  padding: 0;
  22.  margin: 0;
  23. }
  24.  
  25.  
  26. a, a:link, a:active, a:visited {
  27.  text-decoration: none;
  28.  color: #0088ff;
  29. }
  30.  
  31. div.entry {
  32.  padding: 0 20px 20px 25px;
  33.  border-bottom: 1px solid #ddd;
  34. }
  35.  
  36. div.content img {
  37. }
  38.  
  39. div.active {
  40.  background-color: #f1f5fa;;
  41. }
  42.  
  43. .read .title a {
  44.  color: #aaa;
  45. }
  46.  
  47.  
  48. .read .content {
  49.  color: #555;
  50. }
  51.  
  52. div.entry .read .title a {
  53.  color: gray;
  54. }
  55.  
  56. .header {
  57.  padding-top: 20px;
  58.  margin: 0 0 0.2em 0;
  59. }
  60.  
  61. .title {
  62.  font-size: 1.6em;
  63.  font-family: arial, verdana, tahoma;
  64.  font-weight: bold;
  65.  letter-spacing: -1px;
  66.  line-height: 1.1em;
  67. }
  68.  
  69. div.details {
  70.  color: gray;
  71.  margin-bottom: 0.5em;
  72. }
  73. div.clear {
  74.  clear:both;
  75.  height: 1px;
  76.  width: 1px;
  77.  font-size: 1px;
  78.  line-height: 1px;
  79. }
  80. span.modified, span.author, span.category {
  81. }
  82.  
  83. .status a {
  84.  display:block;
  85.  line-height: 0;
  86.  font-size: 0;
  87.  width: 8px; 
  88.  height: 8px;
  89.  margin-top: -1.5em;
  90.  background-image: url('<xsl:value-of select="/feed:feed/fr:imagebase"/>stylesheet/unread_8x8.png');
  91.  background-repeat: no-repeat;
  92. }
  93.  
  94. .read .status a {
  95.  background-image: url('<xsl:value-of select="/feed:feed/fr:imagebase"/>stylesheet/read_8x8.png');
  96. }
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103. </style>
  104.     
  105.  
  106.   </head>    
  107.   <body>
  108.   <script type="text/javascript">
  109.   var imagebase='file://<xsl:value-of select="/feed:feed/fr:imagebase"/>';
  110.   </script>
  111.   <xsl:apply-templates select="feed:feed"/>
  112.   </body>
  113. </html>
  114. </xsl:template>
  115.  
  116. <xsl:template match="feed:feed">
  117.   <xsl:apply-templates select="feed:entry"/>
  118. </xsl:template>
  119.  
  120. <xsl:template match="feed:entry">
  121.           <base>
  122.               <xsl:attribute name="href"><xsl:value-of select = "feed:source/feed:link[@rel='alternate'][1]/@href"/>/</xsl:attribute>
  123.             </base>
  124.     <div class="entry">
  125.         <xsl:attribute name="id">article<xsl:value-of select="fr:item_id"/></xsl:attribute>
  126.         <xsl:if test="fr:rtlEnabled = 1">
  127.             <xsl:attribute name="style">direction:RTL;font-size: 1.1em;font-family: tahoma;</xsl:attribute>
  128.         </xsl:if>
  129.         <xsl:if test="fr:status = 1">
  130.             <xsl:attribute name="class">entry read</xsl:attribute>
  131.         </xsl:if>
  132.                 
  133.         <div class="header">
  134.  
  135.         <span class="title">
  136.         <xsl:choose>
  137.                 <xsl:when test="string-length(feed:link/@href)>0">
  138.               <a>
  139.             <xsl:attribute name="href"><xsl:value-of select="feed:link/@href"/></xsl:attribute>
  140.             <xsl:value-of select="feed:title"/>
  141.             </a>
  142.                 </xsl:when>
  143.                 <xsl:otherwise>
  144.             <xsl:value-of select="feed:title"/>
  145.                 </xsl:otherwise>
  146.                  </xsl:choose>
  147.         </span>
  148.  
  149.           <span class="status">
  150.           <xsl:attribute name="style">float:right;</xsl:attribute>
  151.           <xsl:if test="fr:rtlEnabled = 1">
  152.             <xsl:attribute name="style">float:left;</xsl:attribute>
  153.           </xsl:if>
  154.           <xsl:if test="fr:rtlEnabled != 1">
  155.             <xsl:attribute name="style">float:right;</xsl:attribute>
  156.           </xsl:if>
  157.           
  158.           <a>
  159.              
  160.           <xsl:attribute name="id">togglelink<xsl:value-of select="fr:item_id"/></xsl:attribute>
  161.             <xsl:attribute name="href">fr:toggleread/<xsl:value-of select="fr:item_id"/></xsl:attribute>
  162.           <xsl:attribute name="onclick">this.blur();</xsl:attribute>
  163.                    
  164.           </a>
  165.           </span>
  166.         </div>
  167.     
  168.                 <div class="details">
  169.              <span class="updated"><xsl:value-of select="fr:updated"/>, </span>        
  170.             <xsl:if test="feed:author"> 
  171.                   <span class="author">
  172.                 <xsl:apply-templates select="feed:author"/>
  173.                 </span>
  174.             </xsl:if>
  175.             <a>
  176.             <xsl:attribute name="href">fr:edittags/<xsl:value-of select="fr:item_id"/></xsl:attribute>
  177.  
  178.             <img>
  179.             <xsl:attribute name="border">0</xsl:attribute>
  180.             <xsl:attribute name="hspace">5</xsl:attribute>
  181.             <xsl:attribute name="src">file://<xsl:value-of select="/feed:feed/fr:imagebase"/>stylesheet/tag_edit.png</xsl:attribute>
  182.             </img>
  183.             </a>
  184.                         
  185.             <xsl:if test="feed:category">
  186.                   <span class="category"> 
  187.                   <xsl:apply-templates select="feed:category"/>
  188.                 </span>
  189.                     </xsl:if>
  190.             <xsl:if test="feed:source">
  191.                   <span class="source"> 
  192.                 <a>
  193.                 <xsl:attribute name="href">fr:feed/<xsl:value-of select="feed:source/fr:feed_id"/></xsl:attribute>
  194.                 <xsl:value-of select="feed:source/feed:title"/>
  195.                 </a>
  196.                 <a>
  197.                 <xsl:attribute name="href">
  198.                 <!-- <xsl:for-each select = "feed:source/feed:link[@rel='alternate']"> --> 
  199.                     <xsl:value-of select = "feed:source/feed:link[@rel='alternate'][1]/@href"/> 
  200.                     <!-- </xsl:for-each> -->
  201.                 </xsl:attribute>
  202.                       
  203.             <img>
  204.             <xsl:attribute name="border">0</xsl:attribute>
  205.             <xsl:attribute name="hspace">5</xsl:attribute>
  206.             <xsl:attribute name="src">file://<xsl:value-of select="/feed:feed/fr:imagebase"/>stylesheet/world_go.png</xsl:attribute>
  207.             </img>
  208.                 </a>                                  
  209.                 </span>
  210.                                 
  211.                     </xsl:if>
  212.         </div>
  213.  
  214.     <xsl:if test="feed:content">
  215.         <div class="content">
  216.             <xsl:value-of disable-output-escaping="yes" select="feed:content"/>
  217.         </div>
  218.     </xsl:if>
  219.     <div class="clear" />
  220.     </div>
  221.  
  222. </xsl:template>
  223.  
  224. <xsl:template match="feed:category">
  225.   <a>
  226.   <xsl:attribute name="href">fr:<xsl:value-of select="./@scheme"/></xsl:attribute>
  227.   <xsl:value-of select="./@term"/>
  228.   </a>, 
  229. </xsl:template>
  230.  
  231. <xsl:template match="feed:author">
  232.   <xsl:value-of select="feed:name"/>, 
  233. </xsl:template>
  234.  
  235. </xsl:stylesheet>
  236.